﻿using FxResources.Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

namespace 依赖注入;

class Program
{
    static void Main(string[] args)
    {
        ServiceCollection sc = new ServiceCollection();
        sc.AddTransient<ITestService,TestServiceImpl2>();
        using (ServiceProvider sp = sc.BuildServiceProvider())
        {
             var tm1 = sp.GetService<ITestService>();
             tm1.Name = "lili";
             tm1.SayHi();
        }
    }
}